﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Modifying the Hibernate Configuration File</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {
	color: #000000;
	font-weight: bold;
}
.style3 {color: #000000}
-->
</style>
</head>

<body>
<P><FONT size=5 face=Verdana color=#0000ff>Modifying the Hibernate Configuration 
File</FONT></P>
<P>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#000000 cellSpacing=0 
cellPadding=2 width="100%" border=1>
  
  <TR>
    <TD><FONT ><FONT face=Courier 
      size=3><SPAN 
      style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">When 
      you create a new project that uses the Hibernate framework</SPAN></FONT></FONT></TD>
    <TD><FONT ><FONT face=Courier><FONT 
      >&nbsp;khi bạn tạo một project 
      mới sử dụng Hibernate framework</FONT> </FONT> </FONT>        
       </TD></TR>
  <TR>
    <TD><FONT ><FONT><FONT ><FONT face=Courier><FONT 
      ><FONT color=#333333><FONT 
      > 
the IDE automatically creates the<SPAN 
class=Apple-converted-space>&nbsp;</SPAN></FONT></FONT></FONT><FONT size=3><TT 
style="WORD-SPACING: 0px; FONT: 1.1em/18px 'Courier New', monospace; TEXT-TRANSFORM: none; COLOR: black; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">hibernate.cfg.xml</TT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><SPAN 
class=Apple-converted-space>&nbsp;</SPAN>configuration file at the root of the 
context classpath of the application (in the Files window,<SPAN 
class=Apple-converted-space>&nbsp;</SPAN></SPAN><TT 
style="WORD-SPACING: 0px; FONT: 1.1em/18px 'Courier New', monospace; TEXT-TRANSFORM: none; COLOR: black; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">src/java</TT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">).</SPAN></FONT></FONT></FONT></FONT></FONT></TD>
    <TD><FONT ><FONT><FONT ><FONT face=Courier>&nbsp;IDE tự động tạo ra file cấu hình&nbsp;<FONT 
      >hibernate.cfg.xml</FONT></FONT></FONT></FONT></FONT></TD></TR>
  <TR>
    <TD><FONT face=Courier><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"> 
The file is located in the<SPAN 
class=Apple-converted-space>&nbsp;</SPAN></SPAN><TT 
style="WORD-SPACING: 0px; FONT: 1.1em/18px 'Courier New', monospace; TEXT-TRANSFORM: none; COLOR: black; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">&lt;default 
package&gt;</TT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"> 
            
         
           under 
the Source Packages node in the Projects window.</SPAN></FONT></TD>
    <TD><FONT face=Courier></FONT></TD></TR>
  <TR>
    <TD><FONT face=Courier><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">The configuration file contains information about the 
      database connection,<SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"> 
            
         
            
  resource mappings, and other connection properties</SPAN> 
            
         
            
       </SPAN></FONT></TD>
    <TD><FONT face=Courier>file config 
      chứa đựng thông tin về việc kết nối database, tài nguyên ảnh và các thuộc 
      tính kết nối khác</FONT></TD></TR>
  <TR>
    <TD>
<P><FONT ><FONT><FONT 
><FONT face=Courier><FONT size=3><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"> 
            
         
  You can edit the file using the multi-view editor, or 
edit the XML directly in the XML editor</SPAN></FONT></FONT></FONT></FONT></FONT></P></TD>
    <TD>bạn có thể sửa file này sử dụng 
...</TD></TR></TABLE></P>
<P><FONT face=Courier>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#000000 cellSpacing=0 
cellPadding=2 width="100%" border=1>
  
  <TR>
    <TD>&nbsp;<SPAN 
      style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">In 
      this exercise you will edit the default properties specified in<SPAN 
      class=Apple-converted-space>&nbsp;</SPAN></SPAN><TT 
      style="WORD-SPACING: 0px; FONT: 1.1em/18px 'Courier New', monospace; TEXT-TRANSFORM: none; COLOR: black; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">hibernate.cfg.xml</TT><SPAN 
      style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><SPAN 
      class=Apple-converted-space>&nbsp;</SPAN>to enable debug logging for SQL 
      statements and to enable Hibernate's session context management</SPAN></TD>
    <TD>&nbsp;</TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD>&nbsp;</TD></TR></TABLE></FONT></P>
<P><FONT face=Courier></FONT>&nbsp;</P>
<P><FONT ><FONT><FONT 
><FONT face=Courier><FONT size=3><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"> 
            
         
            
       </SPAN></FONT></FONT></FONT></FONT></FONT>&nbsp;</P>
<P><FONT ><FONT><FONT 
><FONT face=Courier><FONT size=3><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><FONT style="BACKGROUND-COLOR: #ffff00"><FONT 
face="Courier New" color=#000000 size=4>hibernate.cfg.xml</FONT><SPAN 
      style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><SPAN 
      class=Apple-converted-space>&nbsp;</SPAN>      
             </SPAN></FONT> 
            
         
            
       </SPAN></FONT></FONT></FONT></FONT></FONT></P>
<P><FONT ><FONT><FONT 
><FONT ><FONT size=3 face=Courier><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">&lt;hibernate-configuration&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;session-factory 
name="session1"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property 
name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;<BR>
<FONT 
color=#ff0000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property 
name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<span class="style1">&lt;property 
name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/sakila&lt;/property&gt;</span><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<span class="style1">&lt;property 
name="hibernate.connection.username"&gt;root&lt;/property&gt;</span><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<span class="style1">&lt;property 
name="hibernate.connection.password"&gt;######&lt;/property&gt;</span><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<span class="style2">&lt;property 
name="hibernate.show_sql"&gt;true&lt;/property&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.query.factory_class"&gt;org.hibernate.hql.classic.ClassicQueryTranslatorFactory&lt;/property&gt;</span><BR>
&nbsp;&nbsp;&nbsp; 
<span class="style3">&lt;/session-factory&gt;<BR>
&lt;/hibernate-configuration&gt;</span> 
            
         
            
       </SPAN></FONT></FONT></FONT></FONT></FONT></P></FONT>
</body>
</html>
